<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="id">
        <div class="class">
            <input type="button" value="点击抛出错误" onclick="errorClick()">
            <input type="button" value="点击抛出promise错误" onclick="promiseErrorClick()">
        </div>
    </div>
    <script>
        // js代码错误
        function errorClick(){
            window.someVar.error = 'error'
        }
        // promise错误
        function promiseErrorClick(){
            new Promise((res,rej) => {
                window.someVar.error = 'error'

            }).then(res => {
                console.log(res);
            })
        }
    </script>
    <!-- 资源加载错误/ -->
    <!-- <script src="someVar.js"></script> -->
</body>
</html>